package com.punai.evaluationSystem.costDataEvalute.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.punai.common.annotation.Excel;
import com.punai.common.core.domain.BaseEntity;
import com.punai.evaluationSystem.costDataEvalute.bo.CostDataEvaluteBo;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * info对象 evaluation_cb_info
 *
 * @author tj
 * @date 2023-04-25
 */
public class EvaluationCbInfo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * $column.columnComment
     */
    private String id;
    /**
     * 旧数据的ID(cbFeeItem的ID)
     */
    @Excel(name = "旧数据的ID(cbFeeItem的ID)")
    private String oid;
    /**
     * 原始编码
     */
    @Excel(name = "原始编码")
    private String orginCode;
    /**
     * 原始编码(含流水码)
     */
    @Excel(name = "原始编码(含流水码)")
    private String code;
    /**
     * 原始名称
     */
    @Excel(name = "原始名称")
    private String name;
    /**
     * 原始特征值
     */
    @Excel(name = "原始特征值")
    private String tzz;
    /**
     * 原始单位
     */
    @Excel(name = "原始单位")
    private String jldw;
    /**
     * 原始工作内容
     */
    @Excel(name = "原始工作内容")
    private String gznr;
    /**
     * 原始计算规则
     */
    @Excel(name = "原始计算规则")
    private String jsgz;
    /**
     * 原始价
     */
    @Excel(name = "原始价")
    private BigDecimal price;
    /**
     * 原始价格来源
     */
    @Excel(name = "原始价格来源")
    private String jgly;
    /**
     * 原始归属项目
     */
    @Excel(name = "原始归属项目")
    private String proid;
    /**
     * 记录表ID
     */
    @Excel(name = "记录表ID")
    private String pid;
    /**
     * 源数据JSON
     */
    @Excel(name = "源数据JSON")
    private String dataJson;

    @TableField(exist = false)
    private String pjjgsj;

    @TableField(exist = false)
    private String address;

    @TableField(exist = false)
    private String projectDept;

    @TableField(exist = false)
    private String pjType;

    public static List<EvaluationCbInfo> convert(String pid, List<CostDataEvaluteBo> boList){
        List<EvaluationCbInfo> res = new ArrayList<>();
        if(boList!=null){
            for (CostDataEvaluteBo bo : boList) {
                EvaluationCbInfo info = new EvaluationCbInfo();
                info.setId(null);
                info.setOid(bo.getOid());
                info.setPid(pid);
                info.setOrginCode(bo.getOrginCode());
                info.setCode(bo.getFyxCode());
                info.setName(bo.getFyxName());
                info.setTzz(bo.getTzz());
                info.setJldw(bo.getJldw());
                info.setGznr(bo.getGznr());
                info.setJsgz(bo.getJsgz());
                info.setPrice(bo.getPrice());
                info.setJgly(bo.getPriceType());
                info.setProid(bo.getProid());
                info.setDataJson(bo.getDataJson());
                res.add(info);
            }
        }
        return res;
    }

    public String getProjectDept() {
        return projectDept;
    }

    public void setProjectDept(String projectDept) {
        this.projectDept = projectDept;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPjType() {
        return pjType;
    }

    public void setPjType(String pjType) {
        this.pjType = pjType;
    }

    public String getPjjgsj() {
        return pjjgsj;
    }

    public void setPjjgsj(String pjjgsj) {
        this.pjjgsj = pjjgsj;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setOid(String oid) {
        this.oid = oid;
    }

    public String getOid() {
        return oid;
    }

    public void setOrginCode(String orginCode) {
        this.orginCode = orginCode;
    }

    public String getOrginCode() {
        return orginCode;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setTzz(String tzz) {
        this.tzz = tzz;
    }

    public String getTzz() {
        return tzz;
    }

    public void setJldw(String jldw) {
        this.jldw = jldw;
    }

    public String getJldw() {
        return jldw;
    }

    public void setGznr(String gznr) {
        this.gznr = gznr;
    }

    public String getGznr() {
        return gznr;
    }

    public void setJsgz(String jsgz) {
        this.jsgz = jsgz;
    }

    public String getJsgz() {
        return jsgz;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setJgly(String jgly) {
        this.jgly = jgly;
    }

    public String getJgly() {
        return jgly;
    }

    public void setProid(String proid) {
        this.proid = proid;
    }

    public String getProid() {
        return proid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }


    public String getPid() {
        return pid;
    }

    public void setDataJson(String dataJson) {
        this.dataJson = dataJson;
    }

    public String getDataJson() {
        return dataJson;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("oid", getOid())
                .append("orginCode", getOrginCode())
                .append("code", getCode())
                .append("name", getName())
                .append("tzz", getTzz())
                .append("jldw", getJldw())
                .append("gznr", getGznr())
                .append("jsgz", getJsgz())
                .append("price", getPrice())
                .append("jgly", getJgly())
                .append("proid", getProid())
                .append("pid", getPid())
                .append("createTime", getCreateTime())
                .append("createBy", getCreateBy())
                .append("updateTime", getUpdateTime())
                .append("updateBy", getUpdateBy())
                .append("dataJson", getDataJson())
                .toString();
    }
}
